/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.crm.store;

import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.B630;
import queenb.web.crm.inteface.B630Inf;
import queenb.web.util.PackageContants;

/**
 *
 * @author Nguyen Hung
 */
public class B630Store extends B630 implements B630Inf {

    @Override
    public List<B630> getListAllB630(int pvPB630, Date pdBD632, Date pdBD633, String pvB639, int pnFC500, int pnFB670, int pnFH000,
            int pnFH200, int pnFK100, int pnFB050, int pnFN100, String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_B630, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pvPB630),
                    new Param(OracleTypes.DATE, pdBD632),
                    new Param(OracleTypes.DATE, pdBD633),
                    new Param(OracleTypes.CHAR, pvB639),
                    new Param(OracleTypes.INTEGER, pnFC500),
                    new Param(OracleTypes.INTEGER, pnFB670),
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFK100),
                    new Param(OracleTypes.INTEGER, pnFB050),
                    new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });
        try {
            return super.find(dataStatement, B630.class);
        } catch (SQLException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    @Override
    public List<B630> getListAllB630COM(int pnPB630, Date pdBD632, Date pdBD633, String pvBV639, 
    int pnBN640, int pnFC500, int pnFB670, int pnFH000, int pnFH200, int pnFK100, 
    String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_B630COM, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPB630),
                    new Param(OracleTypes.DATE, pdBD632),
                    new Param(OracleTypes.DATE, pdBD633),
                    new Param(OracleTypes.CHAR, pvBV639),
                    new Param(OracleTypes.INTEGER, pnBN640),
                    new Param(OracleTypes.INTEGER, pnFC500),
                    new Param(OracleTypes.INTEGER, pnFB670),
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFK100),
                   
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });
        try {
            return super.find(dataStatement, B630.class);
        } catch (SQLException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    @Override
    public int updateByB630(int pvPB630, String pvBV631, int pnFC500, Timestamp pdBD632, Timestamp pdBD633,
            int pnBD634, String pvBV635, String pvBV636, String pvBV637, String pvBV638, String pvBV639, int pnBN640, int pnFB670, int pnFH000,
            int pnFH200, int pnFK100, int pnFB050, String pvNV106, int fq100, String pvLOGIN) {
        try {
            DataStatement dateStatement = new DataStatement(PackageContants.UPDATE_B630, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pvPB630),
                        new Param(OracleTypes.CHAR, pvBV631),
                        new Param(OracleTypes.INTEGER, pnFC500),
                        new Param(OracleTypes.TIMESTAMP, pdBD632),
                        new Param(OracleTypes.TIMESTAMP, pdBD633),
                        new Param(OracleTypes.INTEGER, pnBD634),
                        new Param(OracleTypes.CHAR, pvBV635),
                        new Param(OracleTypes.CHAR, pvBV636),
                        new Param(OracleTypes.CHAR, pvBV637),
                        new Param(OracleTypes.CHAR, pvBV638),
                        new Param(OracleTypes.CHAR, pvBV639),
                        new Param(OracleTypes.INTEGER, pnBN640),
                        new Param(OracleTypes.INTEGER, pnFB670),
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnFK100),
                        new Param(OracleTypes.INTEGER, pnFB050),
                        new Param(OracleTypes.CHAR, pvNV106),
                        new Param(OracleTypes.INTEGER, fq100),
                        new Param(OracleTypes.CHAR, pvLOGIN)});

            return super.update(dateStatement, B630.class);
        } catch (SQLException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    @Override
    public int deleteByB630(int pvPB630, int pnFB670, int pnFH000,
            int pnFH200, int pnFK100, int pnFB050, String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.DELETE_B630, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pvPB630),
                    new Param(OracleTypes.INTEGER, pnFB670),
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFK100),
                    new Param(OracleTypes.INTEGER, pnFB050),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });
        try {
            return super.update(dataStatement, B630.class);
        } catch (SQLException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    @Override
    public List<B630> getListCombB670(int pnFH000, int pnFH200, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.LIST_COMBB670, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.find(dataStatement, B630.class);
        } catch (SQLException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    @Override
    public int deleteByB630i(int pvPB630, String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.DELETE_B630, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pvPB630),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });
        try {
            return super.update(dataStatement, B630.class);
        } catch (SQLException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    @Override
    public List<B630> getListB630CN(int pnPB630, Date pdBD632, Date pdBD633, String pvBV639, int pnBN640, int pnFC500,
            int pnFB670, int pnFH000, int pnFH200, int pnFK100, int pnFB050, int pnFN100, String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_B630CN, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPB630),
                    new Param(OracleTypes.DATE, pdBD632),
                    new Param(OracleTypes.DATE, pdBD633),
                    new Param(OracleTypes.CHAR, pvBV639),
                    new Param(OracleTypes.INTEGER, pnBN640),
                    new Param(OracleTypes.INTEGER, pnFC500),
                    new Param(OracleTypes.INTEGER, pnFB670),
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFK100),
                    new Param(OracleTypes.INTEGER, pnFB050),
                    new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });
        try {
            return super.find(dataStatement, B630.class);
        } catch (SQLException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    @Override
    public List<B630> getListB630CNO(int pnPB630, Date pdBD632, Date pdBD633, String pvBV639, int pnBN640, int pnFC500, int pnFH000, int pnFH200, int pnFK100, int pnFB050, int pnFN100, String pvLOGIN) {
         DataStatement dataStatement = new DataStatement(PackageContants.LIST_B630CNO, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPB630),
                    new Param(OracleTypes.DATE, pdBD632),
                    new Param(OracleTypes.DATE, pdBD633),
                    new Param(OracleTypes.CHAR, pvBV639),
                    new Param(OracleTypes.INTEGER, pnBN640),
                    new Param(OracleTypes.INTEGER, pnFC500),
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFK100),
                    new Param(OracleTypes.INTEGER, pnFB050),
                    new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });
        try {
            return super.find(dataStatement, B630.class);
        } catch (SQLException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    @Override
    public List<B630> getListB630CCO(int pnPB630, Date pdBD632, Date pdBD633, String pvBV639, int pnBN640, int pnFC500, int pnFH000, int pnFH200, int pnFB050, String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_B630COO, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPB630),
                    new Param(OracleTypes.DATE, pdBD632),
                    new Param(OracleTypes.DATE, pdBD633),
                    new Param(OracleTypes.CHAR, pvBV639),
                    new Param(OracleTypes.INTEGER, pnBN640),
                    new Param(OracleTypes.INTEGER, pnFC500),
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFB050),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });
        try {
            return super.find(dataStatement, B630.class);
        } catch (SQLException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    @Override
    public List<B630> LISTOFTABB650(int pnFH000, int pnFH200, int pnFB630, String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_B650, OracleTypes.CURSOR, new Param[]{                    
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFB630),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });
        try {
            return super.find(dataStatement, B630.class);
        } catch (SQLException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    @Override
    public int INSERTTABB650(int pnPB650, String pvBV651, String pvBV652, int pnFB630, String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.UPDATE_B650, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPB650),
                    new Param(OracleTypes.CHAR, pvBV651),
                    new Param(OracleTypes.CHAR, pvBV652),
                    new Param(OracleTypes.INTEGER, pnFB630),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });
        try {
            return super.update(dataStatement, B630.class);
        } catch (SQLException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return -1;
        }
    }

    @Override
    public int STORNOTABB650(int pnPB650, int pnFB630, String pvLOGIN) {
       DataStatement dataStatement = new DataStatement(PackageContants.DELETE_B650, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPB650),                    
                    new Param(OracleTypes.INTEGER, pnFB630),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });
        try {
            return super.update(dataStatement, B630.class);
        } catch (SQLException ex) {
            Logger.getLogger(B630Store.class.getName()).log(Level.SEVERE, null, ex);
            return -1;
        }
    }
}
